<?php

require_once 'Zend/View/Helper/Abstract.php';

class Core_View_Helper_Admin_SelectSkin extends Zend_View_Helper_Abstract
{
    /**
     *
     */
    public function selectSkin($name, $value = null, $attr = null, $defaut = null)
    {
        $config = Zend_Registry::get('config');
        $pathToPublicSkins = $config->design->pathToSkins;
        $skins = Core_Filesystem_Dir::getDirectories($pathToPublicSkins);
        if ($defaut == NULL) {
            $defaut = $this->view->getTranslation('Select One');
        }
        $options[0] = $defaut;

        if (is_array($skins)) {
            foreach ($skins as $skin) {
                $options[$skin] = $skin;
            }
            return $this->view->formSelect($name, $value, $attr, $options);
        } else {
            return null;
        }
    }
}